package com.homegoods.discover.item;

import android.databinding.ObservableArrayList;
import android.databinding.ObservableBoolean;
import android.databinding.ObservableList;

import com.homegoods.discover.R;
import com.homegoods.discover.model.BannerModel;
import com.kedll.library.mvp.BaseItem;

import java.util.List;


/**
 * @author QiQi
 */
public class ADViewItem extends BaseItem {

    public final ObservableList<BannerModel> images = new ObservableArrayList<>();
    public final ObservableBoolean running = new ObservableBoolean();

    public ADViewItem(Object data) {
        super(data);
    }


    public void setImages(List<BannerModel> imgUrl) {
        this.images.clear();
        this.images.addAll(imgUrl);
    }


    @Override
    public synchronized int getLayout() {
        return R.layout.discover_head_ad_layout;
    }

    public void start() {
        setRunning(true);
    }

    public void setRunning(boolean isRunning) {
        running.set(isRunning);
    }

    public void stop() {
        setRunning(false);
    }
}